cmake_minimum_required(VERSION 3.0.0)
project(dxyreflect VERSION 0.1.0)

option(DXY_REFLECT_TEST_ENABLED "test enabled")

set(DXY_REFLECT_TEST_ENABLED ON)
message(STATUS DXY_REFLECT_TEST_ENABLED=${DXY_REFLECT_TEST_ENABLED})

set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
file(GLOB_RECURSE SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE HEADER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
file(COPY ${HEADER_FILE} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include)



include_directories(${INCLUDE_DIR})

add_library(${PROJECT_NAME} SHARED ${SOURCE_FILE})

target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIR})


########
# test #
########
if(DXY_REFLECT_TEST_ENABLED)
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
endif()


